package operation;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class Find implements Ioperation{

    @Override
    public void work(BookList bookList) {
        Scanner in = new Scanner(System.in);
        System.out.println("输入要查找的图书名字：");
        String name = in.nextLine();
        for(int i = 0; i < bookList.getUsedSize(); i++){
            Book book = bookList.getBooks()[i];
            if(name.equals(book.getName())){
                System.out.println("图书存在");
                return ;
            }
        }
        System.out.println("图书不存在");
    }
}
